import axios from "../utils/request";

//获取文章列表
export function articleList(params) {
  return axios({
    url: "/post",
    method: "GET",
    params,
  });
}

// 文章发布
export function publish(data) {
  return axios({
    url: "/post",
    method: "POST",
    data,
  });
}

// 获取文章详情
export function article(id) {
  return axios({
    url: "/post/" + id,
    method: "get",
  });
}

//编辑文章
export function editArticle(id, data) {
  return axios({
    url: "/post_update/" + id,
    method: "POST",
    data,
  });
}
